| Einhugur Xml Plugin for Xojo |
|
Document.SaveToFile Method
Saves the document to file.

SaveToFile(
f
as FolderItem,
overwrite
as Boolean)
Parameters
- f
- The file to save to.
- overwrite
- If true then existing file if any will be overwritten.
Remarks
This function can throw EinhugurXmlException.
Example:
var type as new FileType
type.Extensions = "xml;"
var f as FolderItem = FolderItem.ShowSaveFileDialog(type,"untitled.xml")
if f = nil then
return
end if
using EinhugurXml
var document as new Document()
var root as Node = document.Child("Guestbook",true)
var guest as Node = root.AppendChild("Guest")
guest.AppendChild("FirstName").TextValue = "Björn"
guest.AppendChild("LastName").TextValue = "Eiríksson"
guest.AppendAttribute("RoomNumber").Set(103)
guest.AppendAttribute("Arrival").Set(new DateTime(2024,4,21))
guest = root.AppendChild("Guest")
guest.AppendChild("FirstName").TextValue = "Sven"
guest.AppendChild("LastName").TextValue = "Fox"
guest.AppendAttribute("RoomNumber").Set(103)
guest.AppendAttribute("Arrival").Set(new DateTime(2024,3,13))
try
document.SaveToFile(f, false)
catch ex as EinhugurXmlException
MessageBox(ex.Message)
end try
See Also
Document Class